package com.yykj.tencent.im.server.converter;

import com.yykj.tencent.im.server.dto.C2CMessageDTO;
import com.yykj.tencent.im.server.dto.GroupSuppleDTO;
import com.yykj.tencent.im.server.model.entity.C2CMessage;
import com.yykj.tencent.im.server.model.entity.GroupMsgElement;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class GroupSuppleConverter {
    public static GroupSuppleDTO convert(GroupMsgElement item){
        GroupSuppleDTO dto = new GroupSuppleDTO();
        BeanUtils.copyProperties(item,dto);
        return dto;
    }

    public static List<GroupSuppleDTO> convert(List<GroupMsgElement> list){
        return list.stream().map(GroupSuppleConverter::convert).collect(Collectors.toList());
    }


}
